<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渠道规则</title>
    <link rel="shortcut icon" href="favicon.ico">
    <script src="../../res/js/comm.js"></script>
    <link href="../../res../res/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="../../res/plugins/chosen/css/chosen.css" rel="stylesheet">
    <link href="../../res/plugins/channel/css/yfChannel.css" rel="stylesheet">
    <script src="../../res/plugins/channel/yfChannelRule.js"></script>
    <script src="../../res/plugins/chosen/js/chosen.jquery.js"></script>


</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-info">
        <div class="panel-heading"><i class="fa fa-info-circle"></i> 渠道规则</div>
        <div class="panel-body">

            <div class="ibox-query">
                <form id="ruleQueryForm" method="post" class="form-horizontal">
                    <div class="form-group">
                        <div class="col-md-1" style="width: auto">
							<label class="control-label">渠&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;道</label>
						</div>
                        <div class="col-md-2">
							<input placeholder="渠道" id="channelCode" name="channelCode1" class="form-control" type="text">
						</div>
                        <input type="hidden" name="channelCodes" id="channelCodes">
                        <div class="col-md-1" style="width: auto">
							<label class="control-label">规则编码</label>
						</div>
                        <div class="col-md-2">
							<input placeholder="规则编码" id="ruleCode" name="ruleCode" class="form-control" type="text">
						</div>
                        <div>
                            <button style="margin-left: 100px;" class="btn btn-info" onclick='search()' type="button"><i class="glyphicon glyphicon-search"></i> 查询</button>
                            <button style="margin-left: 10px;" class="btn btn-info" onclick="resetForm()" type="button"><i class="glyphicon glyphicon-share-alt"></i> 重置  </button>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                </form>
            </div>

            <div class="row row-lg">
                <div class="col-sm-12">
                    <div id="partnerbar"></div>
                    <table id="table">
                        <thead>
                            <tr>
                                <th data-field="stats" data-checkbox="true"></th>
                                <th data-align="center" data-field="id" data-visible="false"></th>
                                <th data-align="center" data-field="channelCode" data-visible="false"></th>
                                <th data-align="center" data-field="name">所属渠道</th>
                                <th data-align="center" data-field="ruleCode" >规则编码</th>
                                <th data-align="center" data-field="ruleName" >规则名称</th>
                                <th data-align="center" data-field="status" data-formatter="statusFormat" data-width="150px">状态</th>
                                <th data-align="center" data-field="createTime" data-formatter="dateFormat">创建时间</th>
                                <th data-align="center" data-field="creator">创建人</th>
                                <!-- <th data-field="status" data-formatter="statusFormat" data-width="80px">状态</th> -->
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>


<!--新增规则界面-->

<div id="addUpdateTpl" class="modal fade" aria-hidden="true" style="display: none;">
    <div class="modal-dialog" style="width: 700px; ">
        <div class="modal-content animated bounceInTop" >
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                    aria-hidden="true">&times;</button>
                <h4 class="modal-title">新增渠道规则</h4>
            </div>
            <div class="modal-body" style="padding-top: 0px;">
                <div style="width: 600px; height: auto;padding: 5px 30px;">
                    <form class="form-horizontal" name="addRuleForm" id="addRuleForm" enctype="multipart/form-data" method="post">
                    
                    <div class="row" style="padding-top: 15px;">
                        <div class="col-md-3" style="width: auto">
                            <label class="control-label" style="padding-left:50px;">渠&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;道</label>
                        </div>
                        <div class="col-md-6">
                            <input placeholder="渠道" id="channelCodeImport" name="channelCode2" class="form-control" type="text">
                        </div>
                    </div>
                    <input type="hidden" name="channelCodes1" id="channelCodesImport">
                
                   <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-4 control-label" style="margin-left:-50px"><font color="red">* </font>规则编码</label>
                        <div class="col-sm-8">
                            <input name="ruleCode" id="ruleCode1" class="form-control" style="margin-left:-5px" placeholder="请输入规则编码"    type="text" required="true" >
                        </div>
                    </div>

                    <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-4 control-label" style="margin-left:-50px"><font color="red">* </font>规则名称</label>
                        <div class="col-sm-8">
                            <input name="ruleName" id="ruleName" class="form-control" style="margin-left:-5px" placeholder="请输入规则名称"    type="text" required="true" >
                        </div>
                    </div>

                    <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-4 control-label" style="margin-left:-50px">规则备注</label>
                        <div class="col-sm-8">
                            <input name="ruleRemark" id="ruleRemark" class="form-control" style="margin-left:-5px" placeholder="请输入备注信息"    type="text" >
                        </div>
                    </div>

                    <div class="row" style="padding-top: 15px;" id="contain1">
                        <div class="row" id = "divRow" style="margin-top: 10px;">
                            
                            <label class="col-sm-2 control-label" style="margin-left:20px"><font color="red">* </font>键</label>
                            <div class="col-sm-3">
                                <input name="key"  class="form-control" style="margin-left:-5px" placeholder="请输入key"    type="text"  >
                            </div>
                            <label class="col-sm-2 control-label" style="margin-left:-20px"><font color="red">* </font>值</label>
                            <div class="col-sm-3">
                                <input name="value"  class="form-control" style="margin-left:-5px" placeholder="请输入value"    type="text"  >
                            </div>
                            <div >
                                <button type="button" style="margin-left:60px;margin-top:7px;" name='deleteRow'
                                 class="btn btn-outline btn-default btn-xs"  disabled="disabled" onclick="javascript:deleteRowsData(this.parentNode.parentNode)">删除</button>
                            </div>
                            
                        </div>
                    </div>


                    

                    <div class="row" id="addNew" style="margin-top: 20px;margin-left:20px; text-align: center;">
                        <button class="btn btn-info" type="button" onclick="addOther()" >
                            <strong>添加新的键值对</strong>
                        </button>
                    </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer"
                style="margin: 0 auto; text-align: center;">
                <button class="btn btn-info" type="button" onclick="submitTo()" >
                    <strong>提交</strong>
                </button>
            </div>
        </div>
    </div>
</div>


<div id="updateTpl" class="modal fade" aria-hidden="true" style="display: none;">
    <div class="modal-dialog" style="width: 700px; ">
        <div class="modal-content animated bounceInTop" >
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                    aria-hidden="true">&times;</button>
                <h4 class="modal-title">更新渠道规则</h4>
            </div>
            <div class="modal-body" style="padding-top: 0px;">
                <div style="width: 600px; height: auto;padding: 5px 30px;">
                    <form class="form-horizontal" name="updateRuleForm" id="updateRuleForm" enctype="multipart/form-data" method="post">
                    
                    <div class="row" style="padding-top: 15px;">
                        <div class="col-md-3" style="width: auto">
                            <label class="control-label" style="padding-left:50px;">渠&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;道</label>
                        </div>
                        <div class="col-md-6">
                            <input placeholder="渠道" disabled id="channelCodeImport2" name="channelCode2" class="form-control" type="text">
                        </div>
                    </div>
                    <input type="hidden" name="ruleId" id="ruleId">
                
                   <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-4 control-label" style="margin-left:-50px"><font color="red">* </font>规则编码</label>
                        <div class="col-sm-8">
                            <input name="ruleCode" id="ruleCode2" class="form-control" style="margin-left:-5px" placeholder="请输入规则编码"    type="text" required="true" >
                        </div>
                    </div>

                    <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-4 control-label" style="margin-left:-50px"><font color="red">* </font>规则名称</label>
                        <div class="col-sm-8">
                            <input name="ruleName" id="ruleName2" class="form-control" style="margin-left:-5px" placeholder="请输入规则名称"    type="text" required="true" >
                        </div>
                    </div>

                    <div class="row" style="padding-top: 15px;">
                        <label class="col-sm-4 control-label" style="margin-left:-50px">规则备注</label>
                        <div class="col-sm-8">
                            <input name="ruleRemark" id="ruleRemark2" class="form-control" style="margin-left:-5px" placeholder="请输入备注信息"    type="text" >
                        </div>
                    </div>

                    <div class="row" style="padding-top: 15px;" id="contain2">
                        <div class="row" id = "divRow2" style="margin-top: 10px;">
                            <label class="col-sm-2 control-label" style="margin-left:20px"><font color="red">* </font>键</label>
                            <div class="col-sm-3">
                                <input name="key"  class="form-control" style="margin-left:-5px" placeholder="请输入key"    type="text"  >
                            </div>
                            <label class="col-sm-2 control-label" style="margin-left:-20px"><font color="red">* </font>值</label>
                            <div class="col-sm-3">
                                <input name="value"  class="form-control" style="margin-left:-5px" placeholder="请输入value"    type="text"  >
                            </div>
                            <div >
                                    <button type="button" style="margin-left:60px;margin-top:7px;" name='deleteRow'
                                     class="btn btn-outline btn-default btn-xs"  disabled="disabled" onclick="javascript:deleteRowsData(this.parentNode.parentNode)">删除</button>
                                </div>
                                
                        </div>
                    </div>


                    

                    <div class="row" id="addNew" style="margin-top: 20px;margin-left:20px; text-align: center;">
                        <button class="btn btn-info" type="button" onclick="addOther2()" >
                            <strong>添加新的键值对</strong>
                        </button>
                    </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer"
                style="margin: 0 auto; text-align: center;">
                <button class="btn btn-info" type="button" onclick="submitUpdate()" >
                    <strong>提交</strong>
                </button>
            </div>
        </div>
    </div>
</div>

</body>
</html>

<script type="text/javascript">
    (function () {
     $.openx.loadScript(['../../js/channel/channelRule.js','../../res/plugins/yifeng/channel.js']);
    })();
</script>